/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jpa;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@Entity
@Table(name = "comuni")
@NamedQueries({
    @NamedQuery(name = "Comuni.findAll", query = "SELECT c FROM Comuni c"),
    @NamedQuery(name = "Comuni.findById", query = "SELECT c FROM Comuni c WHERE c.id = :id"),
    @NamedQuery(name = "Comuni.findByIdRegione", query = "SELECT c FROM Comuni c WHERE c.idRegione = :idRegione"),
    @NamedQuery(name = "Comuni.findByIdProvincia", query = "SELECT c FROM Comuni c WHERE c.idProvincia = :idProvincia")})
public class Comuni implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Column(name = "id_regione")
    private Integer idRegione;
    @Column(name = "id_provincia")
    private Integer idProvincia;
    @Lob
    @Column(name = "comune")
    private String comune;

    public Comuni() {
    }

    public Comuni(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getIdRegione() {
        return idRegione;
    }

    public void setIdRegione(Integer idRegione) {
        this.idRegione = idRegione;
    }

    public Integer getIdProvincia() {
        return idProvincia;
    }

    public void setIdProvincia(Integer idProvincia) {
        this.idProvincia = idProvincia;
    }

    public String getComune() {
        return comune;
    }

    public void setComune(String comune) {
        this.comune = comune;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Comuni)) {
            return false;
        }
        Comuni other = (Comuni) object;
        return (this.id != null || other.id == null) && (this.id == null || this.id.equals(other.id));
    }

    @Override
    public String toString() {
        return "jpa.Comuni[id=" + id + "]";
    }

}
